<?php  	
	require_once("includes/header.php");
	require_once("include_dao.php");		
	
	$dtoPartner = new Partner();			
	$dtoUser 	= new User();
	
	if (isset($_GET['PkPartner']))
		if($_GET['PkPartner'] != '')
		{			
				
			$pkPartner = $_GET['PkPartner'];
			$dtoPartner = DAOFactory::getPartnerDAO()->load($pkPartner);
			$dtoUser = DAOFactory::getUserDAO()->queryByFKPartnerDto($pkPartner);
		}
?>

<div id="mlist">
    <div id="main"><!-- Slidebox -->              
        <div align="center">
            <?php	
				if(isset($_GET["err"])){
					if ($_GET["err"] != ''){
						echo("<marquee>");
						// Mensajes de error 		
							$msn =  msn_error($_GET["err"]);
							echo($msn);
						// Fin de Mensajes de Error			
						echo("</marquee>");
					}
				}
			?> 
            <section class="main">            
                <form class="form-1" method="post" action="class/core/clsAdminRegister.php">
                
                	<input type="hidden" name="PkPartner" value="<?php echo $dtoPartner->pKPartner; ?>">
                    
                	<input type="hidden" name="PkUser" value="<?php  echo $dtoUser->pKUser; ?>">                    
                    
                    <p class="field">
                        <input type="text" name="name" placeholder="Nombre" maxlength="50" value="<?php echo $dtoPartner->name; ?>">
                        <i class="icon-edit icon-large"></i>
                    </p>
                    
                    <p class="field">
          				<input type="text" name="user" placeholder="Usuario" value="<?php echo $dtoUser->user; ?>">
                        <i class="icon-user icon-large"></i>
                    </p>
                    
                    <p class="field">
                        <input type="password" name="pass" placeholder="Contraseña" maxlength="50" value="<?php echo $dtoUser->pass; ?>">
						<i class="icon-lock icon-large"></i>
                    </p>
                    
                    <p class="field">
                        <input type="password" name="confpass" placeholder="Confirmaci&oacute;n" maxlength="50" value="<?php echo $dtoUser->pass; ?>">
                        <i class="icon-lock icon-large"></i>
                    </p>
                    
                    <p class="field">
                        <input type="text" name="meanscontact" placeholder="Medios de Contacto" maxlength="500" value="<?php echo $dtoPartner->meansContact; ?>">
                            
                        </input>
                        <i class="icon-search icon-large"></i>
                    </p>                    
                    
                    <p class="field">
                        <input type="text" name="meansidentification" placeholder="Medios de Identificacci&oacute;n" maxlength="50" value="<?php echo $dtoPartner->meansIdentification; ?>">
                        <i class="icon-screenshot icon-large"></i>
                    </p>
                    
                    <p class="field">
                        <input  type="date" name="birthdate" placeholder="Fecha de Nacimiento" value="
							<?php 
								if($dtoPartner->birthdate != ""){
										 echo $dtoPartner->birthdate;
										 
								}
								else {
										echo date('Y-m-d'); 
								}
									
									
							?>">
                        <i class="icon-calendar icon-large"></i>
                    </p>
                    
                    <p class="field">
                    <select name='cbxRol'> 
                    	<option value='1' >Usuario</option>
                       <option value='1' selected="true" >Empleado </option>
 					</select>
                    </p>
                    
                    <p class="submit">
                        <button type="submit" name="submit">
                        	<i class="icon-pencil icon-large"></i>
                        </button>
                    </p>
                </form>                
            </section> 
            </br></br>          
        </div>    
           
        <div class="clear"></div>
        
    </div>
</div>     

<?php	require_once("includes/footer.php");	?>